package com.cloud.screen.api.controller;

import com.cloud.screen.api.service.ForceService;
import com.cloud.screen.common.result.Quokka;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: quokka-server
 * @description: force for  screen
 * @author: sl
 * @create: 2019-07-04 15:12
 **/
@RestController
@RequestMapping("screen/api/force")
public class ForceController {


    @Autowired
    private ForceService forceService;

    /**
     * 案件指数 搜索条件 时间区间 省市 rec_type_id
     * @param start
     * @param end
     * @param regionid
     * @param type
     * @return
     */
    @GetMapping("getLegalCaseInfo")
    public Quokka getLegalCaseInfo(String start , String end, Long regionid, Integer type, Integer recType){
        return new Quokka(true, forceService.getLegalCaseInfo(start,end,regionid,type,recType));
    }

    /**
     * 问题来源 搜索条件 时间区间、省市
     * @param start
     * @param end
     * @param regionid
     * @return
     */
    @GetMapping("getLegalCaseSource")
    public Quokka getLegalCaseSource(String start ,String end,Long regionid,Integer recType){
        return new Quokka(true, forceService.getLegalCaseSource(start,end,regionid,recType));
    }

    /**
     * 区域分布
     * @param start
     * @param end
     * @param regionid
     * @param recType
     * @return
     */
    @GetMapping("getLegalCaseRegion")
    public Quokka getLegalCaseRegion(String start ,String end,Long regionid,Integer recType){
        return new Quokka(true, forceService.getLegalCaseRegion(start,end,regionid,recType));
    }

    /**
     * top5
     * @param start
     * @param end
     * @param regionid
     * @param recType
     * @return
     */
    @GetMapping("getLegalCaseDomain")
    public Quokka getLegalCaseDomain(String start ,String end,Long regionid,Integer recType){
        return new Quokka(true, forceService.getLegalCaseDomain(start,end,regionid,recType,5));
    }

    /**
     * 首页悬浮栏
     * @param start
     * @param end
     * @return
     */
    @GetMapping("getLegalCaseGeneral")
    public Quokka getLegalCaseGeneral(String start ,String end,Long regionid){
        return new Quokka(true, forceService.getLegalCaseGeneral(start,end,regionid));
    }

    /**
     * 法律法规top5
     * @return
     */
    @GetMapping("getLawCaseTop5")
    public Quokka getLawCaseTop5(String start, String end, Long regionid, Integer recType){
        return new Quokka(true, forceService.getLawCaseTop5(start,end,regionid,recType));
    }

    /**
     * 行政强制部门数量
     * @param start
     * @param end
     * @param regionid
     * @return
     */
    @GetMapping("getForceByRegionId")
    public Quokka getForceByRegionId(String start ,String end,Long regionid, Integer recType){
        return new Quokka(true, forceService.getForceByRegionId(start,end,regionid,recType));
    }

}
